package com.yuexun.dhdoctor.module.meetingMaterial.model.impl;


import com.yuexun.dhdoctor.module.meetingMaterial.api.MeetingMaterialApi;
import com.yuexun.dhdoctor.module.meetingMaterial.bean.MeetingMaterialListBean;
import com.yuexun.dhdoctor.module.meetingMaterial.model.IMeetingMaterialModel;
import com.yuexun.dhdoctor.util.ApiUtil;

import rx.Observable;

/**
 * Created by Administrator on 2016/11/15.
 */
public class MeetingMaterialModel implements IMeetingMaterialModel {

    MeetingMaterialApi api;

    private MeetingMaterialApi getApi(){
        if(api!=null){
            return  api;
        }
        return ApiUtil.getInstance().createRetrofitApi(MeetingMaterialApi.class);
    }

    @Override
    public Observable<MeetingMaterialListBean> getMeetingMaterialList(String sessionUuid, String title, String startDate, String endDate, int pageSize, int pageIndex, boolean adminFlag) {
        api=getApi();
        return api.inquireMeetingMaterialList(sessionUuid, title, startDate, endDate, pageSize, pageIndex, adminFlag);
    }
}
